const type = {
  SET_TRANSLATE: 'SET_TRANSLATE'
};

const state = {
  translate: 'google'
};

const getters = {
  translate: state => state.translate
};

const mutations = {
  [type.SET_TRANSLATE](state, translate) {
    if (translate) state.translate = translate;
    else state.translate = 'google'
  }
};

const actions = {
  setTranslate: ({commit}, translate) => {
    commit(type.SET_TRANSLATE, translate)
  }
};

export default {
  state,
  getters,
  mutations,
  actions
}
